package com.tigger.core.redis.lock.redisson;

import java.util.concurrent.TimeUnit;

import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;

public class RedissonLocks {

    public void testLock(RedissonClient client) {
        try {
            RLock rLock = client.getLock("lock_test");
            boolean res = rLock.tryLock(30, 100, TimeUnit.MILLISECONDS);
            if (res) {

                rLock.unlock();
            }

        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {

    }
}
